<template>
    <div id="test">
      <h1>测试,这是主页面</h1>
      <button class="btn" @click="test">按钮</button>
    </div>
</template>

<script>
    import axios from "axios";
      export default {
        methods: {
          test:function () {
            axios.post("/api/sysLogin", {uname:"admin",upass:"admin"}).then(res=>{
              if (res.data=="main"){
                alert("success");
              }else {
                this.$message.error("fail");
              }
            })
          }
        }
    }
</script>

<style scoped>


</style>
